package com.sxbbc.common.core.enums;

import com.sxbbc.common.basics.utils.calculation.CalcuUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author leehao
 * @description 资金金明细类型
 * @date 2019-05-07 16:42
 */
public enum HandleTypeEnums {
    BUY(1,"商品购买"),  //
    RECHARGE(2,"余额充值"), //X
    CASH(3,"提现"),
    SALE(4,"商品出售"),
    SYS_OPERATION(5,"系统操作"),
    WITHDRAWALS_BACK(6,"提现退还"),
    REFUND(7, "退款成功"),
    CHANGE(8, "资金转换"),
	OFFLINE_BUY(14, "线下买单"), //
    FARM_BUY(15, "农场购买"),  //
    ORDER_REFUND(16, "订单退款"),//
    FARM_LOGISTICS_ORDER(11,"物流提鸡"),//
    SHOP_REWARD(12,"购物奖励"),// 旧系统typeid,新系统运行后该类型作废
	MONEY_FREEZE(17, "金额冻结"),
	POINT_FREEZE(18, "积分冻结"),
	PLAT_SEND_PROFIT(19, "平台发放分红","PSP"),
	POINT_BUY(20, "积分购买"),
	TRANS(21,"转账","T"),
    FREIGHT(91,"运费结算"),
	TO_DONATE(101, "转换贡献值"),
	TO_MONEY(103, "转换余额"),

    ONLINE_DIRECT_PUSH(106,"自营商城直推奖励"),//使用
    ONLINE_INDIRECT_PUSH(107,"自营商城间推奖励"),//使用
    OFFLINE_DIRECT_PUSH(108,"线下消费直推奖励"),//使用
    OFFLINE_INDIRECT_PUSH(108,"线下消费间推奖励"),//使用


    TEAM_SMALL_REWARD(306,"团队奖小型养殖户奖励"),//使用
    TEAM_LARGE_REWARD(307,"团队奖大型养殖户奖励"),//使用
    EQUAL_REWARD(308,"同级会员提成奖励"),//使用



    RECOMMEND_MERCHANT(22, "推荐商家奖励"),//使用
	AGENT_REWARD(110,"代理奖励"), //使用
    FUND(200,"基金"), // 使用
    FARM_BONUS(205, "挂售分红"), // 使用
    ORDER_REFUND_APPLY(207, "退款申请"), //使用
    ORDER_REFUND_REFUSE(208, "退款驳回"); //使用
    private Integer id;
    private String name;
    /** 前缀  大写字母*/
    private String prefix;

    HandleTypeEnums(Integer id, String name) {
        this.id = id;
        this.name = name;
        this.prefix = "";
    }
    
    private HandleTypeEnums(Integer id, String name, String prefix) {
		this.id = id;
		this.name = name;
		this.prefix = prefix;
	}





	public String getPrefix() {
		return prefix;
	}



	public void setPrefix(String prefix) {
		this.prefix = prefix;
	}



	public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static List<HandleTypeEnums> queryList() {
        List<HandleTypeEnums> list = new ArrayList<HandleTypeEnums>();
        for (HandleTypeEnums o : HandleTypeEnums.values()) {
            list.add(o);
        }
        return list;
    }

    public static String getName(Integer id) {
        String str = "";
        for (HandleTypeEnums o : HandleTypeEnums.values()) {
            if (CalcuUtils.getInstance().isEquals(id, o.getId())) {
                str = o.getName();
                break;
            }
        }
        return str;
    }
}
